package com.yiwei.zxp.api.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;
import com.yiwei.zxp.api.bean.ParamsBean;
import com.yiwei.zxp.api.bean.ResponModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by xsooy-pc on 18-5-24.
 */

public class GoodsDetailModel extends ResponModel implements Parcelable {


    /**
     * datas : {"goods_id":1,"goods_no":"xxxxxxxxxxx","title":"老乌龟一只","photos":["http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg"],"price":"998.00","deliver_fee":"25.00","cate_id":"35","cate_name":"宠物生活","province_id":"1","province":"北京","city_id":"2","city":"北京市","params":[{"name":"我是标题","value":"我是内容"},{"name":"我是标题1","value":"我是内容2"}],"details":["http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg"],"is_favorites":"1","status":"1"}
     */

    public DatasBean datas;

    public static class DatasBean implements Parcelable {
        /**
         * goods_id : 1
         * goods_no : xxxxxxxxxxx
         * title : 老乌龟一只
         * photos : ["http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg"]
         * price : 998.00
         * deliver_fee : 25.00
         * cate_id : 35
         * cate_name : 宠物生活
         * province_id : 1
         * province : 北京
         * city_id : 2
         * city : 北京市
         * params : [{"name":"我是标题","value":"我是内容"},{"name":"我是标题1","value":"我是内容2"}]
         * details : ["http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg","http://img3.dianhuohuo.shop/2018/05/23/201805231024507830.jpg"]
         * is_favorites : 1
         * status : 1
         */
        public String shop_id;
        public String goods_id;
        public String goods_no;
        public String title;
        public String price;
        public String shop_name;
        public String shop_img;
        public String shop_phone;

        public String deliver_fee;
        public String cate_id;
        public String cate_name;
        public String province_id;
        public String province;
        public String sell;
        public String inventory;
        public String city_id;
        public String city;
        public String is_favorites;
        public String status;
        public List<String> photos;
        public List<ParamsBean> params;
        public ArrayList<String> details;
        public List<SingCateModel> cate_lists;

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.shop_id);
            dest.writeString(this.goods_id);
            dest.writeString(this.goods_no);
            dest.writeString(this.title);
            dest.writeString(this.price);
            dest.writeString(this.shop_name);
            dest.writeString(this.shop_img);
            dest.writeString(this.shop_phone);
            dest.writeString(this.deliver_fee);
            dest.writeString(this.cate_id);
            dest.writeString(this.cate_name);
            dest.writeString(this.province_id);
            dest.writeString(this.province);
            dest.writeString(this.sell);
            dest.writeString(this.inventory);
            dest.writeString(this.city_id);
            dest.writeString(this.city);
            dest.writeString(this.is_favorites);
            dest.writeString(this.status);
            dest.writeStringList(this.photos);
            dest.writeTypedList(this.params);
            dest.writeStringList(this.details);
            dest.writeList(this.cate_lists);
        }

        public DatasBean() {
        }

        protected DatasBean(Parcel in) {
            this.shop_id = in.readString();
            this.goods_id = in.readString();
            this.goods_no = in.readString();
            this.title = in.readString();
            this.price = in.readString();
            this.shop_name = in.readString();
            this.shop_img = in.readString();
            this.shop_phone = in.readString();
            this.deliver_fee = in.readString();
            this.cate_id = in.readString();
            this.cate_name = in.readString();
            this.province_id = in.readString();
            this.province = in.readString();
            this.sell = in.readString();
            this.inventory = in.readString();
            this.city_id = in.readString();
            this.city = in.readString();
            this.is_favorites = in.readString();
            this.status = in.readString();
            this.photos = in.createStringArrayList();
            this.params = in.createTypedArrayList(ParamsBean.CREATOR);
            this.details = in.createStringArrayList();
            this.cate_lists = new ArrayList<SingCateModel>();
            in.readList(this.cate_lists, SingCateModel.class.getClassLoader());
        }

        public static final Creator<DatasBean> CREATOR = new Creator<DatasBean>() {
            @Override
            public DatasBean createFromParcel(Parcel source) {
                return new DatasBean(source);
            }

            @Override
            public DatasBean[] newArray(int size) {
                return new DatasBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.datas, flags);
    }

    public GoodsDetailModel() {
    }

    protected GoodsDetailModel(Parcel in) {
        this.datas = in.readParcelable(DatasBean.class.getClassLoader());
    }

    public static final Creator<GoodsDetailModel> CREATOR = new Creator<GoodsDetailModel>() {
        @Override
        public GoodsDetailModel createFromParcel(Parcel source) {
            return new GoodsDetailModel(source);
        }

        @Override
        public GoodsDetailModel[] newArray(int size) {
            return new GoodsDetailModel[size];
        }
    };
}